<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
namespace JfbQueue\Driver;

use Hyperf\AsyncQueue\JobInterface;

interface DriverInterface
{

    public function getMaxAttempts(): int;
    
    /**
     * Push a job to queue.
     */
    public function push(array $messages, int $delay = 0): array|bool;

    /**
     * Delete a delay job to queue.
     */
    //public function delete(JobInterface $job): bool;
    
    public function init();

    /**
     * Pop a job from queue.
     */
    public function pop(): array|bool;

    /**
     * Delete a delay job to queue.
     */
    public function ack(array $messages): bool;

    /**
     * retry
     */
    public function retry(array $messages, int $retryTime = 5): bool;

    /**
     * Push a job to failed queue.
     */
    public function fail(array $messages): bool;

    /**
     * Consume jobs from a queue.
     */
    //public function consume(): array;

    public function reload(): bool;


    // queue length
    public function len(): int;
}
